package com.sz.converter.string;

import org.springframework.http.MediaType;
import org.springframework.http.converter.StringHttpMessageConverter;

import java.io.IOException;
import java.nio.charset.Charset;

/**
 * 乱码问题
 * http://www.cnblogs.com/coderland/p/5902867.html
 * 详细查阅该网址
 * @框架文件
 * @author 哈尼玛
 *
 */
public class MyStringHttpMessageConverter extends StringHttpMessageConverter {
    
    private static final MediaType utf8 = new MediaType("text", "plain", Charset.forName("utf-8"));
    
    @Override
    protected MediaType getDefaultContentType(String t) throws IOException {
        return utf8;
    }

}
